<template>
    <view>
        <template v-for="(item, index) in DetectLossDetectList">
            <j-cell-group :key="index" :title="'通道' + index">
                <j-cell title="丢失检测开启" :more="false">
                    <view slot="tips">
                        <switch :checked="item.Enable" disabled></switch>
                    </view>
                </j-cell>
                <j-cell title="灵敏度" :tips="item.Level"></j-cell>
                <j-cell title="区域块" :tips="item.Region"></j-cell>
                <j-cell-card title="丢失检测联动" :show="false" :is-touch="false" border style="background: #f5f7fb">
                    <j-cell title="事件" :tips="item.EventHandler.EventLatch" :more="false"></j-cell>
                    <j-cell title="事件时间段" :tips="item.EventHandler.TimeSection" :more="false"></j-cell>
                    <j-cell title="录像通道掩码" :tips="item.EventHandler.RecordMask" :more="false"></j-cell>
                    <j-cell title="录像" :more="false">
                        <view slot="tips">
                            <switch :checked="item.EventHandler.RecordEnable" disabled></switch>
                        </view>
                    </j-cell>
                    <j-cell title="录像延时时间" :tips="item.EventHandler.RecordLatch" :more="false"></j-cell>
                    <j-cell title="报警输出通道掩码" :tips="item.EventHandler.AlarmOutMask" :more="false"></j-cell>
                    <j-cell title="报警输出" :more="false">
                        <view slot="tips">
                            <switch :checked="item.EventHandler.AlarmOutEnable" disabled></switch>
                        </view>
                    </j-cell>
                    <j-cell title="报警输出延时时间" :tips="item.EventHandler.AlarmOutLatch" :more="false"></j-cell>
                    <j-cell title="云台联动" :more="false">
                        <view slot="tips">
                            <switch :checked="item.EventHandler.PtzEnable" disabled></switch>
                        </view>
                    </j-cell>
                    <j-cell title="云台联动项" :tips="item.EventHandler.PtzLink" :more="false"></j-cell>
                    <j-cell title="轮询" :more="false">
                        <view slot="tips">
                            <switch :checked="item.EventHandler.TourEnable" disabled></switch>
                        </view>
                    </j-cell>
                    <j-cell title="轮询掩码" :tips="item.EventHandler.TourMask" :more="false"></j-cell>
                    <j-cell title="快照通道号掩码" :tips="item.EventHandler.SnapShotMask" :more="false"></j-cell>
                    <j-cell title="抓图" :more="false">
                        <view slot="tips">
                            <switch :checked="item.EventHandler.SnapEnable" disabled></switch>
                        </view>
                    </j-cell>
                    <j-cell title="本地消息框提示" :more="false">
                        <view slot="tips">
                            <switch :checked="item.EventHandler.TipEnable" disabled></switch>
                        </view>
                    </j-cell>
                    <j-cell title="发送邮件" :more="false">
                        <view slot="tips">
                            <switch :checked="item.EventHandler.MailEnable" disabled></switch>
                        </view>
                    </j-cell>
                    <j-cell title="上传到报警服务器" :more="false">
                        <view slot="tips">
                            <switch :checked="item.EventHandler.MessageEnable" disabled></switch>
                        </view>
                    </j-cell>
                    <j-cell title="消息上传到网络" :more="false">
                        <view slot="tips">
                            <switch :checked="item.EventHandler.MsgtoNetEnable" disabled></switch>
                        </view>
                    </j-cell>
                    <j-cell title="蜂鸣" :more="false">
                        <view slot="tips">
                            <switch :checked="item.EventHandler.BeepEnable" disabled></switch>
                        </view>
                    </j-cell>
                    <j-cell title="语音提示" :more="false">
                        <view slot="tips">
                            <switch :checked="item.EventHandler.VoiceEnable" disabled></switch>
                        </view>
                    </j-cell>
                    <j-cell title="联动视频矩阵通道掩码" :more="false">
                        <view slot="tips">
                            <switch :checked="item.EventHandler.MatrixEnable" disabled></switch>
                        </view>
                    </j-cell>
                    <j-cell title="联动视频矩阵" :tips="item.EventHandler.MatrixMask" :more="false"></j-cell>
                    <j-cell title="日志" :more="false">
                        <view slot="tips">
                            <switch :checked="item.EventHandler.LogEnable" disabled></switch>
                        </view>
                    </j-cell>
                    <j-cell title="Ftp上传" :more="false">
                        <view slot="tips">
                            <switch :checked="item.EventHandler.FtpEnable" disabled></switch>
                        </view>
                    </j-cell>
                    <j-cell title="语音提示类型" :tips="item.EventHandler.VoiceType" :more="false"></j-cell>
                </j-cell-card>
            </j-cell-group>
        </template>
    </view>
</template>

<script>
export default {
    data() {
        return {
            token: '',
            DetectLossDetectList: []
        };
    }
    /**
     * 生命周期函数--监听页面加载
     */,
    onLoad: function (options) {
		this.token = options.token
		this.getconfig();
    },
    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady: function () {},
    /**
     * 生命周期函数--监听页面显示
     */
    onShow: function () {},
    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide: function () {},
    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload: function () {},
    /**
     * 页面相关事件处理函数--监听用户下拉动作
     */
    onPullDownRefresh: function () {},
    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom: function () {},
    /**
     * 用户点击右上角分享
     */
    onShareAppMessage: function () {},
    methods: {
        getconfig() {
            uni.showLoading();
            let token = this.token;
            let data = {
                Name: 'Detect.LossDetect'
            };
            getApp().globalData.api.getconfig(data, token, (result) => {
                uni.hideLoading({
                    success: (res) => {
                        console.log(result);
                        this.DetectLossDetectList = result['Detect.LossDetect']
                    }
                });
            });
        }
    }
};
</script>
<style></style>
